package demo2;
class OuterClass1 {
    public int data1 = 1;
    private int data2 = 2;
    public static int data3 = 3;

    //非静态内部类
    class InnerClass {
        public int data1 = 111111;
        public int data4 = 4;
        private int data5 = 5;

        public static final int data6 = 6;
        public void func () {
            System.out.println("static - > InnerClass :: func()");

            System.out.println(data1); //111111
            System.out.println(OuterClass1.this.data1); //1

            System.out.println(data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(data6);
        }
    }
    public void test () {
        InnerClass innerClass = new InnerClass();
        System.out.println(data1);
        System.out.println(data2);
        System.out.println(data3);
        System.out.println(innerClass.data4);
        System.out.println(innerClass.data5);
        System.out.println(InnerClass.data6);
    }

}
public class Test1 {
    public static void main(String[] args) {
        OuterClass1 outerClass1 = new OuterClass1();
        OuterClass1.InnerClass innerClass = outerClass1.new InnerClass();
        innerClass.func();
    }
}
